package fr.androguies.powerball;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.engine.camera.Camera;
import org.anddev.andengine.engine.options.EngineOptions;
import org.anddev.andengine.engine.options.EngineOptions.ScreenOrientation;
import org.anddev.andengine.engine.options.resolutionpolicy.IResolutionPolicy;
import org.anddev.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;
import org.anddev.andengine.entity.scene.Scene;
import org.anddev.andengine.ui.activity.BaseGameActivity;

import com.googlecode.androidannotations.annotations.EActivity;

import fr.androguies.powerball.scene.LauncherScene;

@EActivity
public class PowerBallActivity extends BaseGameActivity {

	private static final int CAMERA_WIDTH = 480;
	private static final int CAMERA_HEIGHT = 320;
	
	private Camera camera;
	private LauncherScene launcherScene;

	
	@Override
	public Engine onLoadEngine() {
		launcherScene = new LauncherScene(this);
		
		camera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
		
		final IResolutionPolicy resolutionPolicy = new RatioResolutionPolicy(camera.getWidth(), camera.getHeight());
		final EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.LANDSCAPE, resolutionPolicy, camera);
		return new Engine(engineOptions);
	}

	@Override
	public void onLoadResources() {
		launcherScene.loadResources();
	}

	@Override
	public Scene onLoadScene() {
		return launcherScene;
	}

	@Override
	public void onLoadComplete() {
		// TODO Auto-generated method stub
		
	}
    
}